package com.stardata.liangshisq.tcslmon;

import com.stardata.liangshisq.tcslmon.service.ItemQueueService;
import lombok.AllArgsConstructor;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * @author Samson Shu
 * @email shush@stardata.top
 * @date 2020/12/15 23:19
 */
@AllArgsConstructor
@Component
@Order(value = 1)
public class StartService implements ApplicationRunner {
  private final ItemQueueService itemQueueService;

  @Override
  public void run(ApplicationArguments args) throws Exception {
    System.out.println("NOTIFICATION===>   .......................................");
    System.out.println("NOTIFICATION===>   .......................................");
    System.out.println("NOTIFICATION===>   刷新菜品和订单排队...............");
    System.out.println("NOTIFICATION===>   .......................................");
    System.out.println("NOTIFICATION===>   .......................................");
    itemQueueService.refresh();
    System.out.println("NOTIFICATION===>   完成刷新菜品和订单排队...............");
    System.out.println("NOTIFICATION===>   .......................................");
    System.out.println("NOTIFICATION===>   .......................................");
  }
}
